/** 
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
* 
* MpmProjectSaleService
* 项目信息（销售）
* 
* 修改纪录
* 2020-12-25 版本：1.0 lanjianwei 创建。
* @version 版本：1.0
* @author 作者：lanjianwei
* 创建日期：2020-12-25
*/
package com.topscomm.mpm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.alibaba.druid.sql.ast.statement.SQLLateralViewTableSource;
import com.topscomm.mpm.pojo.MpmProjectSaleEntity;
import com.topscomm.mpm.service.IMpmProjectSaleService;
import com.topscomm.mpm.service.impl.auto.MpmProjectSaleServiceAuto;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.StringBufferProxy;

@Service(value = "mpmProjectSaleService")
@Scope(value = "singleton")
public class MpmProjectSaleService extends MpmProjectSaleServiceAuto implements IMpmProjectSaleService {
	@Override
	public boolean isUseForLtc(Map<String, Object> paraMap) {
		String sourcetype = ConvertUtil.convertToString(paraMap.get("sourcetype"));
		String sourcecode = ConvertUtil.convertToString(paraMap.get("sourcecode"));
		StringBufferProxy sql = new StringBufferProxy();
		sql.appendSingle("CHANCECLUE = '{0}' and PROJECTSOURCE= '{1}'",sourcecode,sourcetype);
		List<MpmProjectSaleEntity> mpmProjectSaleEntities = this.queryByWhere(sql.toString());
		if(mpmProjectSaleEntities == null || mpmProjectSaleEntities.size() == 0) {
			return false;
		} else {
			return true;
		}
	}
}
